home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / util / errcheck.c next >
Encoding:
C/C++ Source or Header  |  1996-08-26  |  423 b   |  24 lines

  1. /* errcheck.c */
  2.  
  3.  
  4. /*
  5.  * Call this function in your rendering loop to check for GL errors
  6.  * during development.  Remove from release code.
  7.  */
  8.  
  9.  
  10. #include <GL/gl.h>
  11. #include <GL/glu.h>
  12. #incldue <stdio.h>
  13.  
  14.  
  15.  
  16. GLboolean CheckError( const char *message )
  17. {
  18.    GLenum error = glGetError();
  19.    if (error) {
  20.       char *err = (char *) gluErrorString( error );
  21.       fprintf( stderr, "GL Error: %s at %s\n", err, message );
  22.    }
  23. }
  24.